﻿using ClusteringProblem.Model;
using ClusteringProblem.Model.DatasetInformation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClusteringProblem.DataImport
{
    public class ReadedDataset
    {
        private DataReaderStrategy dataReaderStrategy;
        private List<ClusteringProblem.Model.Object> data = new List<Model.Object>();     
        
        public void SetReadedDataset(DatasetTypes datasetType)
        {
            switch (datasetType)
            {
                case DatasetTypes.glass:
                    this.dataReaderStrategy = new GlassDataReader();
                    break;
                case DatasetTypes.iris:
                    this.dataReaderStrategy = new IrisDataReader();
                    break;
                case DatasetTypes.parkinsons:
                    this.dataReaderStrategy = new ParkinsonsDataReader();
                    break;
                case DatasetTypes.wine:
                    this.dataReaderStrategy = new WineDataReader();
                    break;
                case DatasetTypes.ionosphere:
                    this.dataReaderStrategy = new IonosphereDataReader();
                    break;
                default:
                    break;
            }            
        }
        
        public List<ClusteringProblem.Model.Object> ReadData(string filePath, bool isNormilizeData)
        {
            data = dataReaderStrategy.ReadData(filePath, isNormilizeData);
            return data;
        }
    }
}
